package CreateExecutors;

import CreateThreadPool.T;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class demo3 {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newSingleThreadExecutor();
        executorService.execute(() -> System.out.println(Thread.currentThread().getName() + " ==> 正在执行"));
        executorService.execute(() -> System.out.println(Thread.currentThread().getName() + " ==> 正在执行"));
        executorService.execute(() -> System.out.println(Thread.currentThread().getName() + " ==> 正在执行"));
        executorService.execute(() -> System.out.println(Thread.currentThread().getName() + " ==> 正在执行"));
        executorService.execute(() -> System.out.println(Thread.currentThread().getName() + " ==> 正在执行"));
        executorService.execute(() -> System.out.println(Thread.currentThread().getName() + " ==> 正在执行"));

    }
}
